### This loop will identify all files in all tmp.pbs directories and delete them

#### List all .pbs directories

base.dir = '/home1/99/jc152199/tmp.pbs'

#### Numbers of sub-directories

subdirs = c(1:9)

for (z in subdirs)

	{
	
	#### List files in a single .pbs directory
	
	toremove = list.files(paste(base.dir,z,'/',sep=''), full.names=T)
	
	for (y in toremove)
	
		{
	
		system(paste('rm ',y,sep=''))
	
		}
		
	cat('\nPBS Directory ',z,' Cleared\n',sep='')	
	
	}
	
# Close loop
